package com.zxbit.uangstore.network;

import com.zxbit.uangstore.domain.BlankResponse;
import com.zxbit.uangstore.domain.LoginResponse;
import com.zxbit.uangstore.domain.ProductResponse;
import com.zxbit.uangstore.domain.UpdateResponse;

import io.reactivex.Observable;
import okhttp3.RequestBody;
import retrofit2.http.Body;
import retrofit2.http.Header;
import retrofit2.http.POST;

public interface ApiService {
    String HEADER_TOKEN_KEY = "Authorization";
    String PATH = "channel";

    @POST("/api/super/marketAccountKit/authCodeValidate") // facebook登陆
    Observable<LoginResponse> uploadFaceBookCode(@Body RequestBody commonParams);

    @POST("/api/super/marketProduct/listBySelectiveCashLoan") // 现金贷
    Observable<ProductResponse> getCashLoan(@Body RequestBody commonParams);

    @POST("/api/super/marketProduct/listBySelectiveInstallment") // 分期付款
    Observable<ProductResponse> getInstallment(@Body RequestBody commonParams);

    @POST("/api/super/marketProduct/selectMarketProductDownload") // 历史记录
    Observable<ProductResponse> getHistory(@Header(HEADER_TOKEN_KEY) String token, @Body RequestBody commonParams);

    @POST("/api/super/marketProduct/insertMarketProductDownload") // 添加历史记录
    Observable<BlankResponse> insertHistory(@Header(HEADER_TOKEN_KEY) String token, @Body RequestBody commonParams);

    @POST("/api/super/marketProduct/deleteMarketProductDownload") // 删除
    Observable<BlankResponse> deleteHistory(@Header(HEADER_TOKEN_KEY) String token, @Body RequestBody commonParams);

    @POST("/api/super/marketAppVersion/checkVersionGoogle") // 谷歌更新
    Observable<UpdateResponse> getGooglePlayUpdateInfo(@Header(HEADER_TOKEN_KEY) String token, @Body RequestBody commonParams);
}
